package com.carlinfo.users.pojo;

import java.util.Date;

/**
 * @author Gonsen 实体类
 */
public class ACate {

	/**
	 * 属性对应数据库表中的字段，一一对应
	 * */
	private int id;
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "ACate [id=" + id + ", name=" + name + ", content=" + content + ", status=" + status + ", createTime="
				+ createTime + ", updateTime=" + updateTime + ", pubTime=" + pubTime + ", newsID=" + newsID
				+ ", statusStr=" + statusStr + "]";
	}

	private String name;
	private String content;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;
	private int newsID;
	

	public int getNewsID() {
		return newsID;
	}

	public void setNewsID(int newsID) {
		this.newsID = newsID;
	}

	/*添加一个枚举类用于状态的描述,状态的字符串描述*/
	private String statusStr;
	
	public String getStatusStr() {
		ACateEnum[] cateEnmus = ACateEnum.values();
		for (int i = 0; i < cateEnmus.length; i++) {
			ACateEnum cateEnmu = cateEnmus[i];
			if(cateEnmus.toString().startsWith("STATUS")){
				if(this.getStatus() == cateEnmu.getStatus()){
					this.statusStr = cateEnmu.getName();
				}
			}
		}
		return statusStr;
	}
	
	/**
	 * 读写器，get、set方法
	 * */
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getPubTime() {
		return pubTime;
	}

	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}

	public void setStatusStr(String statusStr) {
		this.statusStr = statusStr;
	}
}
